//
//  CantripDisplayView.h
//  CantripSDK
//
//  Created by James Callender on Tue Apr 30 2002.
//  Copyright (c) 2001 James Callender. All rights reserved.
//

#import <AppKit/AppKit.h>
#import "CantripURLTextView.h"
#import "CantripScrollView.h"
#import "CantripStaticSplitView.h"
#import "CantripStateMachine.h"

@interface CantripDisplayView : NSView
{
    // Display objects
    CantripURLTextView      *_textView;
    CantripScrollView       *_scrollView;
    CantripStaticSplitView  *_splitView;
    NSTextView		    *_top;
    NSSize		    _splitSize;
    
    // Display Mode Info
    CantripStateMachine *_stateMachine;
    NSString	    *_foreColor;
    NSString	    *_backColor;
    unsigned long   _numberOfLines;
    unsigned int    _row, _column;
    BOOL	    _underline, _bold, _blink, _inverse;
    NSTimer	    *_blinkTimer;
    BOOL	    _blinkState;
    
    // RFC 855 options
    int _negotiateState, _opt1, _opt2;
    
    // User options
    NSDictionary	*mAnsiPlainColors;
    NSDictionary	*mAnsiIntenseColors;
    NSColor		*mTextColor;
    NSColor		*mBackgroundColor;
    NSFont		*mFont;
    int			mTabSize;
    long		mScrollBack;
    BOOL		mAnsiEnabled;
    BOOL		mIsLocked;
    BOOL		mSensativeAutoScroll;
    BOOL		mUsesIntenseColors;
    BOOL		mBoldIntenseColors;
    BOOL		blinkingEnabled;
    
    id delegate;
}

- (void)appendAttributedString:(NSAttributedString *)str;
- (void)processString:(NSString *)str;
- (void)clear;

- (void)autoscroll;
- (void)beatTimerAction:(id)sender;

- (void)setTabSize:(int)ts;
- (void)setFont:(NSFont*)font;
- (void)setTextColor:(NSColor*)color;
- (void)setBackgroundColor:(NSColor*)color;
- (void)setAnsiPlainColors:(NSDictionary*)colors;
- (void)setAnsiIntenseColors:(NSDictionary*)colors;
- (void)setUsesIntenseColors:(BOOL)b;
- (void)setBoldIntenseColors:(BOOL)b;
- (void)setScrollBack:(long)s;
- (void)setAnsiEnabled:(BOOL)b;
- (void)setSensativeAutoScroll:(BOOL)b;
- (void)setLocked:(BOOL)b;
- (void)setBlinkingEnabled:(BOOL)b;

- (int)tabSize;
- (BOOL)ansiEnabled;
- (BOOL)blinkingEnabled;
- (NSFont *)font;
- (NSColor *)textColor;
- (NSColor *)backgroundColor;
- (NSDictionary *)ansiPlainColors;
- (NSDictionary *)ansiIntenseColors;
- (long)scrollBack;
- (BOOL)sensativeAutoScroll;
- (BOOL)locked;

- (CantripURLTextView *)textView;

@end

@interface NSObject (CantripDisplayViewDelegate)
- (void)displayView:(CantripDisplayView *)display handleFormattedString:(NSMutableAttributedString *)str;
@end
